FROM node:14
WORKDIR /app

COPY package.json .
COPY yarn.lock .
RUN yarn install

COPY . .

RUN yarn build

ARG MEDIASOUP_MIN_PORT
ARG MEDIASOUP_MAX_PORT
ENV MEDIASOUP_LISTEN_IP=0.0.0.0

ENV MEDIASOUP_MIN_PORT=${MEDIASOUP_MIN_PORT}
ENV MEDIASOUP_MAX_PORT=${MEDIASOUP_MAX_PORT}

EXPOSE 3000
EXPOSE 9000
EXPOSE ${MEDIASOUP_MIN_PORT}-${MEDIASOUP_MAX_PORT}

CMD [ "node", "build/index.js" ]